package com.jier.service;

import com.jier.common.Page;
import com.jier.common.Result;
import com.jier.entities.SystemModule;

import java.util.List;

/**
 * 系统模块业务接口
 *
 * @author jie_r
 * @date 2018/03/08
 */
public interface ISystemModuleService extends IBaseService<SystemModule> {
    /**
     * 获取一级菜单
     *
     * @return
     * @throws Exception
     */
    List<SystemModule> getFirstLevelNaves() throws Exception;

    /**
     * 获取二级菜单
     *
     * @return
     * @throws Exception
     */
    List<SystemModule> getSecondLevelNaves() throws Exception;

    /**
     * 根据角色ID获取一级菜单
     *
     * @param systemRoleId
     * @return
     * @throws Exception
     */
    List<SystemModule> getFirstLevelNavesByRoleId(Integer systemRoleId) throws Exception;

    /**
     * 根据角色ID获取二级菜单
     *
     * @param systemRoleId
     * @return
     * @throws Exception
     */
    List<SystemModule> getSecondLevelNavesByRoleId(Integer systemRoleId) throws Exception;

    /**
     * 获取系统父级模块
     *
     * @param page
     * @return
     * @throws Exception
     */
    Result<SystemModule> getSystemParentModule(Page page) throws Exception;

    /**
     * 获取系统子级模块
     *
     * @param parentId
     * @return
     * @throws Exception
     */
    List<SystemModule> getSystemChildModule(Integer parentId) throws Exception;

    /**
     * 获取最后位系统模块
     *
     * @param parent
     * @return
     * @throws Exception
     */
    SystemModule getLastSystemModule(Integer parent) throws Exception;

    /**
     * 通过【number】获取系统模块
     *
     * @param number
     * @return
     * @throws Exception
     */
    SystemModule getSystemModuleByNumber(String number) throws Exception;

    /**
     * 通过【name】获取系统模块
     *
     * @param name
     * @return
     * @throws Exception
     */
    SystemModule getSystemModuleByName(String name) throws Exception;

    /**
     * 获取系统模块字段
     *
     * @return
     * @throws Exception
     */
    List<SystemModule> getSystemModuleField() throws Exception;

    /**
     * 通过权限编号获取系统模块
     *
     * @param permissionCode
     * @return
     * @throws Exception
     */
    SystemModule getSystemModuleByPermissionCode(String permissionCode) throws Exception;
}
